//
// Created by bxw57 on 2024/6/12.
//

#ifndef CPPPRACTICE_MYARRAY_H
#define CPPPRACTICE_MYARRAY_H

#include <iostream>

template<class T>
class MyArray{
public:
    MyArray(int cap): cap(cap), top(0) {arr = new T[cap];};
    MyArray(const MyArray& tmp);
    void operator=(const MyArray& tmp);
    void push_back(T val);
    T pop();
    int getCap();
    int getNum();
    T indexOf(int idx);
    void show();
private:
    T* arr;
    int top;
    int cap;
};
#endif //CPPPRACTICE_MYARRAY_H
